﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace UrlExtractor
{
    class Program
    {
        static void Main()
        {
            string pattern = @"((www\.)|(https?://))[A-Za-z\._-]+\.[A-Za-z_-]{2,4}";
            string text = "www.afdf.dfsd jsdjkgfkjg gdf http://abv.google.kom d fh jdsfh jwww.fdsf.dfdsf    www.gogle.kom.kom";

            Regex regex = new Regex(pattern);
            Match match = regex.Match(text);
            while (match.Success)
            {
                Console.WriteLine(match.Value);
                match = match.NextMatch();
            }
        }
    }
}
